package com.eclink.asset.common.domain;

import lombok.Data;

@Data
public class CommonResult {

    private boolean success = true;

    private String msg;

    private Object data;

    public CommonResult(boolean success, String msg, Object data) {
        this.success = success;
        this.msg = msg;
        this.data = data;
    }

    public static CommonResult ok(Object data) {
        return new CommonResult(true, null, data);
    }

    public static CommonResult fail(String msg) {
        return new CommonResult(false, msg, null);
    }

}
